package com.wanghengzhi.design.patterns.creational.abstractfactory;


/**
 * @author wanghengzhi
 * @since 2020.11.6
 */
public class ShapeFactory extends AbstractFactory {


    private static final String CIRCLE = "circle";
    private static final String RECTANGLE = "rectangle";
    private static final String SQUARE = "square";

    @Override
    public Shape getShape(String shapeType){
        if(shapeType == null){
            return null;
        }
        if(CIRCLE.equalsIgnoreCase(shapeType)){
            return new Circle();
        } else if(RECTANGLE.equalsIgnoreCase(shapeType)){
            return new Rectangle();
        } else if(SQUARE.equalsIgnoreCase(shapeType)){
            return new Square();
        }
        return null;
    }

    @Override
    public Color getColor(String color) {
        return null;
    }
}
